<html>
	<meta charset="UTF-8"/>
</html>

<script>
	
	var arr = [11,22,33,44,55];
	
	var arr_ = [];
	
	function test(arr,len){
		
		for(var i=0;i<arr.length;i++){
			util(arr,len,i,i);
		}
	}
	
	function util(arr,len,i,j){
		if(arguments.length-3<len){
			
			for(var k=i+1;k<arr.length;k++){
				var str = "util(arr,len,"+k+","+j+',';
				var ar = [];
				for(var x = 4;x<arguments.length;x++){
					ar.push(arguments[x]);
				}

				if(ar.length>0){
					str += ar.join(',')+','+k+')';
				}else{
					str += ar.join(',')+k+')';
				}
				eval(str);
			}
		}else if(arguments.length-3==len){
			var a = [arr[j]];
			for(var y = 4;y<arguments.length;y++){
				a.push(arr[arguments[y]])
			}
			arr_.push(a)
		}
	}
	
	test(arr,2)
	
	console.log(arr_)

</script>